package com.yoyo.framework.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author zyl
 * @Date 2021/6/23 -21:11
 */
@Configuration
public class ResourcesConfig implements WebMvcConfigurer {

    @Value("${shiro.user.indexUrl}")
    private String indexUrl;

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("forward:" + indexUrl);
    }

    @Override
    public  void addResourceHandlers(ResourceHandlerRegistry registry){
    }
}
